home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume6 / context.1 < prev    next >
Encoding:
Internet Message Format  |  1986-11-30  |  3.2 KB

  1. Subject: v06i022:  Manual page for context program (context.1)
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.UUCP
  4.  
  5. Submitted by: cbosgd!pegasus!hansen
  6. Mod.sources: Volume 6, Issue 22
  7. Archive-name: context.1
  8.  
  9. [ Tony Hansen sent me article <728@ncoast.UUCP> from net.sources, a
  10.   manual page for the recently-posted context program.  It was
  11.   written by Jyrki Yli-Nokari (...!mcvax!enea!tut!jty).  Tony
  12.   also rightly takes me to task for letting things out without
  13.   any manpages.  He's right ("a little quality control goes a long
  14.   way"); it won't happen again.  --r$]
  15.  
  16. --------------------CUT HERE--------------------
  17. #!/bin/sh
  18. # This is a shell archive.  Remove anything before this line,
  19. # then unpack it by saving it in a file and typing "sh file".
  20. # Contents:  context.1
  21.  
  22. echo x - context.1
  23. sed 's/^XX//' > "context.1" <<'@//E*O*F context.1//'
  24. XX.TH CONTEXT 1 "6 June 1985"
  25. XX.\" $Header: context.c,v 1.4 85/05/27 21:51:34 bsa Exp $
  26. XX.SH NAME
  27. XXcontext \- find context of lines
  28. XX.SH SYNOPSIS
  29. XX.B context
  30. XX[
  31. XX.B nr_of_lines
  32. XX]
  33. XX.PP
  34. XX.SH DESCRIPTION
  35. XX.I Context
  36. XXfinds the context of located text. It accepts for example
  37. XXcc(1) diagnostics as standard input and gives you the context.
  38. XX.SH OPTIONS
  39. XXIf the optional argument; a number `nr_of_lines' is given,
  40. XXcontext(1) prints that much context before
  41. XXand after the line in question.
  42. XX.SH EXAMPLES
  43. XX.nf
  44. XX% cc foo.c |& context
  45. XX**************
  46. XX* "foo.c", line 5: warning: old-fashioned initialization: use =
  47. XX*****
  48. XX  
  49. XX  main() {
  50. XX      int i;
  51. XX*     long ix.v;
  52. XX      
  53. XX      i = getpid();
  54. XX      if (ix_v = getchar() == EOF)
  55.  
  56. XX**************
  57. XX* "foo.c", line 5: syntax error
  58. XX*****
  59. XX  
  60. XX  main() {
  61. XX      int i;
  62. XX*     long ix.v;
  63. XX      
  64. XX      i = getpid();
  65. XX      if (ix_v = getchar() == EOF)
  66.  
  67. XX**************
  68. XX* "foo.c", line 5: warning: old-fashioned initialization: use =
  69. XX*****
  70. XX  
  71. XX  main() {
  72. XX      int i;
  73. XX*     long ix.v;
  74. XX      
  75. XX      i = getpid();
  76. XX      if (ix_v = getchar() == EOF)
  77.  
  78. XX**************
  79. XX* "foo.c", line 5: v undefined
  80. XX*****
  81. XX  
  82. XX  main() {
  83. XX      int i;
  84. XX*     long ix.v;
  85. XX      
  86. XX      i = getpid();
  87. XX      if (ix_v = getchar() == EOF)
  88.  
  89. XX**************
  90. XX* "foo.c", line 8: ix_v undefined
  91. XX*****
  92. XX      long ix.v;
  93. XX      
  94. XX      i = getpid();
  95. XX*     if (ix_v = getchar() == EOF)
  96. XX          exit(1);
  97. XX      exit(0);
  98. XX  }
  99.  
  100.  
  101. XX%
  102. XX.fi
  103. XX.SH "SEE ALSO"
  104. XXcc(1), grep(1)
  105. XX.SH AUTHOR
  106. XXCopyright (C) 1985 by North Coast Programming.
  107.  
  108. XXThis program, and any documentation for it, is copyrighted by North Coast
  109. XXProgramming.  It may be copied for non-commercial use only, provided that
  110. XXany and all copyright notices are preserved.
  111.  
  112. XXPlease report any bugs and/or fixes to:
  113.  
  114. XX.nf
  115. XXNorth Coast Programming
  116. XX6504 Chestnut Road
  117. XXIndependence, OH 44131
  118.  
  119. XX\&...decvax!cwruecmp!ncoast!bsa
  120. XXncoast!bsa@Case.CSNet
  121.  
  122. XXThis manual page by ...!mcvax!enea!tut!jty (Jyrki Yli-Nokari), to
  123. XXwhom I give many thanks.
  124. @//E*O*F context.1//
  125. chmod u=rw,g=rw,o=rw context.1
  126.  
  127. echo Inspecting for damage in transit...
  128. temp=/tmp/sharin$$; dtemp=/tmp/sharout$$
  129. trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
  130. cat > $temp <<\!!!
  131.      100     290    1850 context.1
  132. !!!
  133. wc  context.1 | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
  134. if test -s $dtemp
  135. then echo "Ouch [diff of wc output]:" ; cat $dtemp
  136. else echo "No problems found."
  137. fi
  138. exit 0
  139.